home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / k3baudiofile.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  2.2 KB  |  86 lines

  1. /* 
  2.  *
  3.  * $Id: k3baudiofile.h 619556 2007-01-03 17:38:12Z trueg $
  4.  * Copyright (C) 2004 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16. #ifndef _K3B_AUDIO_FILE_H_
  17. #define _K3B_AUDIO_FILE_H_
  18.  
  19. #include "k3baudiodatasource.h"
  20.  
  21. #include <k3bmsf.h>
  22. #include <kurl.h>
  23. #include "k3b_export.h"
  24.  
  25. class K3bAudioDecoder;
  26. class K3bAudioTrack;
  27.  
  28.  
  29. /**
  30.  * The K3bAudioFile is the most important audio data source. It gets its data
  31.  * from an audio file and uses a K3bAudioDecoder to decode this data.
  32.  *
  33.  * Be aware that it is currently not possible to change the doc of an AudioFile.
  34.  * The reason for this is the decoder sharing which is in place to allow gapless
  35.  * splitting of audio files into several tracks.
  36.  *
  37.  * \see K3bAudioDoc::createDecoderForUrl
  38.  */
  39. class LIBK3B_EXPORT K3bAudioFile : public K3bAudioDataSource
  40. {
  41.  public:
  42.   /**
  43.    * The AudioFile registers itself with the doc. This is part of the
  44.    * decoder handling facility in K3bAudioDoc which reuses the same decoder
  45.    * for sources with the same url.
  46.    *
  47.    * Use K3bAudioDoc::getDecoderForUrl to create a decoder.
  48.    */
  49.   K3bAudioFile( K3bAudioDecoder*, K3bAudioDoc* );
  50.   K3bAudioFile( const K3bAudioFile& );
  51.  
  52.   /**
  53.    * The AudioFile deregisters itself from the doc. If it was the last file
  54.    * to use the decoder the doc will take care of deleting it.
  55.    */
  56.   ~K3bAudioFile();
  57.  
  58.   const QString& filename() const;
  59.  
  60.   /**
  61.    * The complete length of the file used by this source.
  62.    */
  63.   K3b::Msf originalLength() const;
  64.  
  65.   QString type() const;
  66.   QString sourceComment() const;
  67.  
  68.   bool isValid() const;
  69.  
  70.   K3bAudioDecoder* decoder() const { return m_decoder; }
  71.  
  72.   bool seek( const K3b::Msf& );
  73.  
  74.   int read( char* data, unsigned int max );
  75.  
  76.   K3bAudioDataSource* copy() const;
  77.  
  78.  private:
  79.   K3bAudioDoc* m_doc;
  80.   K3bAudioDecoder* m_decoder;
  81.  
  82.   unsigned long long m_decodedData;
  83. };
  84.  
  85. #endif
  86.